package com.idp.web.test.service.impl;

import com.idp.web.test.service.DetailListService;
import com.idp.web.test.dao.DetailListDao;
import com.idp.web.test.entity.DetailList;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.idp.common.persistence.Page;
import com.idp.common.util.ResourceUtils;

/**
 * 
 * 出入库明细service实现类
 * 
 * <pre>
 * 	历史记录：
 * 	2017-06-06 Amber
 * 	新建文件
 * </pre>
 * 
 * @author
 * 
 * 		<pre>
 * SD
 * 	Amber
 * PG
 *	Amber
 * UT
 *
 * MA
 *         </pre>
 * 
 * @version $Rev$
 *
 *          <p/>
 *          $Id$
 *
 */
@Transactional
@Service("detailListService")
public class DetailListServiceImpl implements DetailListService {

	@Resource
	private DetailListDao detailListDao;

	@Override
	public Page<DetailList> findByPage(DetailList detailList, Page<DetailList> page) {

		page.setResult(detailListDao.find(detailList, page));

		return page;
	}

	@Override
	public List<DetailList> findBySearch(DetailList detailList) {

		return detailListDao.find(detailList);
	}

	@Override
	public DetailList getById(Integer id) {

		return detailListDao.getById(id);
	}

	@Override
	public void add(DetailList detailList) {

		detailListDao.add(detailList);
	}

	@Override
	public void update(DetailList detailList) {

		detailListDao.update(detailList);
	}

	@Override
	public void delete(Integer id) {
		detailListDao.delete(id);
	}

	@Override
	public Page<DetailList> findByTypeId(Integer id, Page<DetailList> page) {
		page.setResult(detailListDao.findByTypeId(id, page));
		return page;
	}

	@Override
	public Page<DetailList> findByTips(Map<String, Object> map, Page<DetailList> page) {
		page.setResult(detailListDao.findByWarehouseAndProductName(map, page));
		return page;
	}

	@Override
	public List<DetailList> findByTips(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return detailListDao.findByWarehouseAndProductName(map);
	}

}